home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1996 #5
/
Amiga Plus CD - 1996 - No. 5.iso
/
pd
/
grafik
/
visual
/
rexx
/
imagefx.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-05-27
|
2KB
|
112 lines
/*
* $VER: 1.01 (2-mar-1995)
*
* Arexx program for Visual to generate thumbnails with ImageFX.
* Written by C.Vallee
*
* This script generates thumbnails for all the selected file
*
*/
options results
gfxport = IMAGEFX.1
/* Loading ImageFX, if not present */
if (~show('p',gfxport)) then do
message "Loading ImageFX..."
address command "run ImageFX:ImageFX Iconify Quiet WB"
message "Waiting for the "||gfxport||" ARexx port..."
/* Waiting for the ARexx port every 2 seconds until present */
do while (~show('p',gfxport))
address command "Wait 2"
check
if rc ~= 0 then exit
end
end
GetInfo
parse var result '"' mypalette '"' w h .
address value gfxport
Redraw Off
Undo Off
Render Mode Hires Lace Ham
Render Colors 64
LockRange 0 Off
Palette 8
LoadPalette '"'mypalette'"' '-1'
LockRange 0 On
address
do forever
check
if rc ~= 0 then break
getselected
if result = "" then break
file = result
i = LASTPOS('/', file)
if i = 0 then i = lastpos(':', file)
name = substr( file , i+1 )
message 'Loading "'||name||'"...'
address
LoadBuffer '"'file'"' Force NoSmooth
if rc = 0 then do
GetMain
parse var result '"' . '"' width height d .
if ( width > w ) | (height > h) then do
if ( width * h ) > (height * w ) then do
height = ( height * w ) % width
width = w
end
else do
width = ( width * h ) % height
height = h
end
end
address VISUAL message 'Scaling "'||name||'"...'
Scale width height
if d == 1 then do
address VISUAL message 'Grey2Color "'||name||'"...'
Grey2Color
end
address VISUAL message 'Rendering "'||name||'"...'
Render Go
SaveRenderedAs ILBM '"'file'.icn"'
Render Close
KillBuffer Force
address
update
end
else do
address
unselect
end
end
address
Undo On
Redraw On
/* Quit ImageFX */
Quit force